package com.backstage.service.impl;

import com.backstage.common.page.Page;
import com.backstage.dao.LogDao;
import com.backstage.entity.Log;
import com.backstage.entity.Menu;
import com.backstage.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:阮雪峰
 * @Date：2017/8/4 23:19
 * @pagekage: com.backstage.service.impl
 * @project: authority
 */
@Service("logService")
public class LogServiceImpl implements LogService {

    @Autowired
    private LogDao logDao;

    @Override
    public void add(Log log) {
        logDao.add(log);
    }

    @Override
    public void logByPage(Page<Log> page, Log log) {
        int totalCol = logDao.getTotalColumn(page, log);
        List<Log> list = logDao.getList(page, log);

        page.setTotal(totalCol);
        page.setRows(list);
    }
}
